package cn.b.sky.mes.em.controller;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.b.sky.user.controller.SecurityController;

@Controller
@RequestMapping(value = "/datatest/*")
public class DateTestController extends SecurityController {
  @RequestMapping("dateTest")
  public String dateTest(Model model, String navTabId) {
    model.addAttribute(NAVTABID, navTabId);
    return "em/datetest/test";
  }

  @RequestMapping("getEvents")
  @ResponseBody
  public List<Map<String, String>> getEvents(Model model, String start, String end) {

    //String s = "[{ \"title\": \"All Day Event\", \"start\": \"2015-10-30\"}]";
    List<Map<String, String>> result = new ArrayList<Map<String, String>>();
    Map<String, String> map = new HashMap<String, String>();
    map.put("title", "All Day Event");
    map.put("start", "2015-10-30");
    result.add(map);
    return result;
  }
}
